package com.eian.boot.module.system.permission.model.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

@Data
@Schema(name = "更新权限请求参数")
public class PermissionUpdateRequest {
    @Schema(description = "权限Id")
    @NotNull(message = "权限Id不能为空")
    private Integer id;

    @Schema(description = "菜单名称")
    @Size(min = 2, max = 50, message = "菜单名称长度必须在2-50个字符之间")
    private String title;

    @Schema(description = "菜单URL路径")
    private String url;

    @Schema(description = "菜单图标")
    private String icon;

    @Schema(description = "前端组件路径")
    private String component;

    @Schema(description = "重定向URL")
    private String redirect;

    @Schema(description = "后端权限编码")
    private String permissionCode;

    @Schema(description = "是否外链")
    private Boolean isExternal;

    @Schema(description = "是否缓存")
    private Boolean isCache;

    @Schema(description = "是否显示")
    private Boolean isVisible;

    @Schema(description = "状态：0-禁用，1-启用")
    @Range(min = 0, max = 1, message = "状态值只能是0或1")
    private Integer status;

    @Schema(description = "排序号")
    @Min(value = 0, message = "排序号不能小于0")
    private Integer sortOrder;

    @Schema(description = "权限描述")
    @Size(max = 500, message = "权限描述长度不能超过500个字符")
    private String description;
}
